#include "Compiler.cpp"

int main(int argc, char *argv[])
{
    cout.unsetf(ios::showpoint);
    if (argc < 2)
    {
        cout << "Err:No file input\n";
        return -1;
    }
    
    FILE *fp = fopen(argv[1], "rb");
    if (!fp)
    {
        cout << "Err:File " << argv[1] << " not exist\n";
        return -1;
    }
    compileInit();
    Parser parser = Parser(argv[1], fp);

    
    for (;;)
    {
        Token* t = parser.getToken();
        if(t->type == tk_eof) {
            break;
        }
        printf("pstr = %s\n", t->val->c_str());  
    }
    
    return 0;
}
